package org.akomantoso.core.io.util.group;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.akomantoso.core.data.Del;
import org.akomantoso.core.data.Ins;
import org.akomantoso.core.data.Mmod;
import org.akomantoso.core.data.Mod;
import org.akomantoso.core.data.Mref;
import org.akomantoso.core.data.Omissis;
import org.akomantoso.core.data.RecordedTime;
import org.akomantoso.core.data.Ref;
import org.akomantoso.core.data.Remark;
import org.akomantoso.core.data.group.ANinline;
import org.akomantoso.core.io.util.Instantiator;

/**
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 */
public final class ANinlineGroup {

	private ANinlineGroup() {
	}

	public static final Map<String, Instantiator<ANinline>> MAP;

	static {

		Map<String, Instantiator<ANinline>> temp = new HashMap<String, Instantiator<ANinline>>();

		// mod
		temp.put(Mod.ELEMENT, new Instantiator<ANinline>() {
			public Mod instantiate() {
				return new Mod();
			}
		});

		// mmod
		temp.put(Mmod.ELEMENT, new Instantiator<ANinline>() {
			public Mmod instantiate() {
				return new Mmod();
			}
		});

		// recordedTime
		temp.put(RecordedTime.ELEMENT, new Instantiator<ANinline>() {
			public RecordedTime instantiate() {
				return new RecordedTime();
			}
		});

		// ref
		temp.put(Ref.ELEMENT, new Instantiator<ANinline>() {
			public Ref instantiate() {
				return new Ref();
			}
		});

		// mref
		temp.put(Mref.ELEMENT, new Instantiator<ANinline>() {
			public Mref instantiate() {
				return new Mref();
			}
		});

		// remark
		temp.put(Remark.ELEMENT, new Instantiator<ANinline>() {
			public Remark instantiate() {
				return new Remark();
			}
		});

		// del
		temp.put(Del.ELEMENT, new Instantiator<ANinline>() {
			public Del instantiate() {
				return new Del();
			}
		});

		// ins
		temp.put(Ins.ELEMENT, new Instantiator<ANinline>() {
			public Ins instantiate() {
				return new Ins();
			}
		});

		// omissis
		temp.put(Omissis.ELEMENT, new Instantiator<ANinline>() {
			public Omissis instantiate() {
				return new Omissis();
			}
		});

		MAP = Collections.unmodifiableMap(temp);
	}

}
